﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>{$_threadtitle$} - 话题 - {$_mtagname$} - 群组 - {site.Name}</title>
<script type="text/javascript" src="{site.Dir}_data/SysConfig.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery-min.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery.form.js"></script>
<script type="text/javascript" src="{site.Dir}scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="{site.Dir}style/global.css" />
<script type="text/javascript" src="{site.Dir}scripts/front.js"></script>
<link type="text/css" rel="stylesheet" href="{site.Dir}_libs/jquery.formvalidator/style.css" />
<script src="{site.Dir}_libs/jquery.formvalidator.js" type="text/javascript"></script>

<script type="text/javascript">
var UserId = "0";
var pagesize=10;
var page=thispage();
(function(){
	$(document).ready(function(){
		$.ajax({
			type:		"get",
			dataType:	"json",
			data:		"time="+(new Date().getTime()),
			url:		site.Dir + "mtag/view/ajax.aspx?mtagid={$_mtagid$}&oper=ajaxCheckPower",
			error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
			success:	function(data){
				$("#li"+data.ismember).show();
				$("#reply_"+data.istalker).show();
				$("#reply"+data.istalker).show();
				$("#del"+data.ismoderator).show();
				$("#good"+data.ismoderator+"_{$_threadisgood$}").show();
				$("#head"+data.ismoderator+"_{$_threadishead$}").show();
			}
		});
		$.ajax({
			type:		"get",
			dataType:	"json",
			data:		"time="+(new Date().getTime()),
			url:		site.Dir + "ajax/user.aspx?oper=ajaxUserInfo",
			success:	function(data){
				UserId = data.userid;
				ajaxList(page);
			}
		});
		
		$('#threadreplyForm').ajaxForm({
			beforeSubmit: JumbotCms.AjaxFormSubmit,
			success :function(data){
				JumbotCms.Eval(data);
			}
		}); 
		$.formValidator.initConfig({onError:function(msg){}});
		$("#txtContent")
			.formValidator({tipid:"tipContent",onshow:"",onfocus:"10-200个字符",oncorrect:""})
			.InputValidator({min:10,max:200,onerror: "10-200个字符,1个汉字为2个字符!"});
		$("#txtCode")
			.formValidator({tipid:"tipCode",onshow:"",onfocus:"4位验证码",oncorrect:""})
			.InputValidator({min:4,max:4,onerror: "位数不对"});
	});
	//Form验证
	JumbotCms.AjaxFormSubmit=function(item){
		try{
			if(jQuery.formValidator.PageIsValid('1'))
			{
				JumbotCms.Loading.show("正在处理，请稍等...");
				return true;
			}else{
				return false;
			}
		}catch(e){
			return false;
		}
	};
})();
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?mtagid={$_mtagid$}&threadid={$_threadid$}&oper=ajaxGetList",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: false});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ajaxManage(act, threadid, mtagid){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+threadid,
		url:		site.Dir + "mtag/view_threadmanage/ajax.aspx?mtagid="+mtagid+"&oper=ajaxManage&act="+act+"&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				if(act!="del")
					window.location.reload();
				else
					window.location.href="{site.Dir}mtag/view_threadlist/index.aspx?mtagid="+mtagid;
				break;
			}
		}
	});
}
function ajaxDelReply(threadreplyid){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+threadreplyid,
		url:		site.Dir + "mtag/view_threadmanage/ajax.aspx?mtagid={$_mtagid$}&oper=ajaxDelReply&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxReply(threadreplyid,threadreplyno){
	if(threadreplyid==0){
		$('#spanTitle').html('回复 #0');
		$('#txtReplyId').val('0');
	}else{
		$('#spanTitle').html('回复 #'+threadreplyno);
		$('#txtReplyId').val(threadreplyid);
	}
		$("#txtContent")[0].focus();
}
</script>
<script type="text/javascript" src="{site.Dir}user/otherfiles/scripts/ajax.js"></script>
</head>
<body>
<style>
@import url({site.Dir}user/otherfiles/css/style.css);
#ucmenu{width:600px;}
</style>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="{site.Dir}user/otherfiles/image/writer_v2/user_home.gif"><a href="{site.Dir}user/index/index.aspx">用户管理中心</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="{site.Dir}user/otherfiles/image/writer_v2/contribute.gif"><a href="{site.Dir}user/contribute/index.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/message.gif"><a href="{site.Dir}user/pmlist/index.aspx">短信</a><em><a href="{site.Dir}user/pmsend/index.aspx">发送</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/friend.gif"><a href="{site.Dir}user/friendlist/index.aspx">好友</a><em><a href="{site.Dir}user/friendadd/index.aspx">添加</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/mtag.gif"><a href="{site.Dir}mtag/index/index.aspx">群组</a><em><a href="{site.Dir}user/mtag_thread">话题</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/favorite.gif"><a href="{site.Dir}user/favorite/index.aspx">收藏夹</a>
			</ul>
		</div>
		<div id="mainarea">
			<h2 class="title"> <img src="{site.Dir}user/otherfiles/image/app/mtag.gif"><a href="{site.Dir}network/mtaglist/index.aspx?{$_mtagid$}#{$_mtagsortid$}">{$_mtagsortname$}</a> - <a href="{site.Dir}mtag/view/index.aspx?mtagid={$_mtagid$}">{$_mtagname$}</a> </h2>
			<div class="tabs_header">
				<ul class="tabs">
					<li><a href="{site.Dir}mtag/view_threadlist/index.aspx?mtagid={$_mtagid$}"><span>返回讨论区</span></a></li>
					<li id="li0" style="display:none;" class="null"><a href="javascript:void(0);" id="mtag_join_{$_mtagid$}" onclick="ConfirmJoinMTag({$_mtagid$})">加入该群组</a></li>
					<li id="li1" style="display:none;" class="null"><a href="{site.Dir}mtag/view_threadadd/index.aspx?mtagid={$_mtagid$}">发起新话题</a></li>
				</ul>
			</div>
			<div id="div_post">
				<div class="board">
					<div id="post_{$_threadid$}_li">
						<ul class="line_list">
							<li>
								<table width="100%">
									<tr>
										<td width="70" valign="top"><div class="avatar48"> <a href="javascript:void(0);" onclick="ShowUserPage({$_threaduserid$});" title="{$_threadusername$}"><img src="{site.Dir}avatar/{$_threaduserid$}_m.jpg" onerror="this.src='{site.Dir}avatar/0_m.jpg'" alt="{$_threadusername$}" class="avatar" /></a> </div></td>
										<td><div class="title">
												<div class="r_option">
<a id="reply1" style="display:none;" href="javascript:void(0)" onclick="ajaxReply(0,0)">回复</a>
<a id="del1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('del', '{$_threadid$}', {$_mtagid$})">删除</a>
<a id="head1_0" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('head1', '{$_threadid$}', {$_mtagid$})">置顶</a>
<a id="head1_1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('head0', '{$_threadid$}', {$_mtagid$})">取消置顶</a>
<a id="good1_0" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('good1', '{$_threadid$}', {$_mtagid$})">精华</a>
<a id="good1_1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('good0', '{$_threadid$}', {$_mtagid$})">取消精华</a>
												</div>
												<h1>{$_threadtitle$}</h1>
												<a href="javascript:void(0);" onclick="ShowUserPage({$_threaduserid$});" title="{$_threadusername$}">{$_threadusername$}</a> <span class="time">{$_threadaddtime$}</span> </div>
											<div class="detail" id="detail_0"> {$_threadcontent$} </div></td>
									</tr>
								</table>
							</li>
						</ul>
					</div>
                    <textarea id="tplList" style="display:none">{#foreach $T.table as record}
<div>
	<ul class="line_list">
		<li>
			<table width="100%">
				<tr>
					<td width="70" valign="top"><div class="avatar48"> <a href="javascript:void(0);" onclick="ShowUserPage({$T.record.replyuserid});" title="{$T.record.replyusername}"><img src="{site.Dir}avatar/{$T.record.replyuserid}_m.jpg" onerror="this.src='{site.Dir}avatar/0_m.jpg'" alt="{$T.record.replyusername}" class="avatar" /></a> </div></td>
					<td><div class="title">
							<div class="r_option">
								{#if $T.record.replyuserid == UserId}
								<a href="javascript:void(0);" onclick="ajaxDelReply({$T.record.replyid})">删除</a>
								{#else}
								<a href="javascript:void(0);" onclick="ajaxReply({$T.record.replyid},{$T.record.no})">回复</a>
								{#/if}
								<span class="time">#{$T.record.no}</span>
							</div>
							<a href="javascript:void(0);" onclick="ShowUserPage({$T.record.replyuserid});" title="{$T.record.replyusername}">{$T.record.replyusername}</a> <span class="time">{$T.record.replyaddtime}</span>
						</div>
						<div class="detail" id="detail_{$T.record.replyid}"> {$T.record.replycontent}</div></td>
				</tr>
			</table>
		</li>
	</ul>
</div>
{#/for}</textarea>
					<div id="ajaxList"></div>
					<div id="ajaxPageBar" class="pages" style="display:none;"> </div>
					<div class="c_form" id="reply_0" style="display:none;"> 你还不是该群组正式成员或被禁止了发言，不能参与讨论。 </div>
					<div class="quickpost" id="reply_1" style="display:none;">
						<form id="threadreplyForm" name="form1" method="post" class="quickpost" action="?act=save&threadid={$_threadid$}&mtagid={$_mtagid$}">
							<table>
								<tr>
									<td><span id="spanTitle"></span><input type="hidden" id="txtReplyId" name="replyid" value="0" /></td>
								</tr>
								<tr>
									<td><textarea id="txtContent" name="txtContent" col="50" rows="6" style="width:450px; height: 6em;"></textarea>
										<div class="ValidatorTip" id="tipContent" style="width:200px"></div></td>
								</tr>
								<tr>
									<td><input class="t_input" size="10" type="text" name="txtCode" id="txtCode" maxlength="4" style="ime-mode:disabled;" onpaste="return false" />
										<img onclick="this.src=jcms$$SetUrlRefresh('{site.Dir}plus/getcode3.aspx?h=22');" src="{site.Dir}plus/getcode3.aspx?h=22" align="absmiddle" style="cursor: pointer" alt="不区分大小写,点击换一张" title="不区分大小写,点击换一张" /><img id="imgRead" src="{site.Dir}publicstyle/maintb.gif" align="absmiddle" style="cursor: pointer" alt="收听验证码" title="收听验证码" onclick="PlayCodeVoice('player');" /><span id="player"></span>
										<div class="ValidatorTip" id="tipCode" style="width:200px"></div></td>
								</tr>
								<tr>
									<td><input type="hidden" name="mtagid" value="{$_mtagid$}" />
										<input type="hidden" name="threadid" value="{$_threadid$}" />
										<input type="submit" id="postsubmit_btn" name="postsubmit_btn" value="回复" class="submit" />
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--/mainarea-->
		<div id="bottom"></div>
	</div>
</div>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
